<template>
	<view class="page">
		<view class="page-main" v-if="article.title">
			<view class="page-title">{{article.title}}</view>
			<view class="update-time">更新时间：{{article.updateTime}}</view>
			<view id="content" v-html="article.content"></view>
		</view>
		<view class="footer">
			<text>made by bihua</text>
		</view>
	</view>
</template>

<script>
	import {
		getArticle
	} from "@/api/wx/article"
	export default {
		data() {
			return {
				articleId: '',
				article: {}
			}
		},
		onLoad(options) {
			console.info(options)
			this.articleId = options.articleId
			this.checkLogin(location.hash)
		},
		mounted() {
			this.getDetail();
		},
		methods: {
			getDetail() {
				if (this.articleId > 0) {
					getArticle(this.articleId).then(response => {
						this.article = response.data;
					});
				}
			},
		}
	}
</script>

<style>
	@import "@/static/css/article.css";

	.page-main {
		background-color: #ffffff;
		padding: 0.8rem;
		word-wrap: break-word;
	}

	.page-title {
		line-height: 25px;
		font-size: 18px;
		color: #666666;
		font-weight: bold;
		border-bottom: 1px solid #dadada;
		padding-bottom: 5px;
	}

	.update-time {
		color: #959595;
		font-size: 12px;
		margin-top: 5px;
		margin-bottom: 20px;
	}

	#content {
		color: #505050;
		font-size: 1rem;
		line-height: 25px;
	}

	.footer {
		margin-top: 30px;
		text-align: center;
	}
</style>